package com.training.food.controller;

import com.training.food.pojo.Farm;
import com.training.food.pojo.Retail;
import com.training.food.service.FarmService;
import com.training.food.util.CommonResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@RestController
public class FarmController {
    @Resource
    FarmService farmService;
    @PostMapping("/food/buy/getfarm")
    public CommonResult SubRetail(HttpServletRequest request){
        List<Farm>farms=farmService.getAll();
        return  CommonResult.success(farms);
    }
}
